package com.tao.handler;

import com.tao.result.Result;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
@Slf4j
public class GlobalExceptionHandler {

    @ExceptionHandler(Exception.class)
    public Result ex(Exception e){
        e.printStackTrace();
        log.info("错误信息：{}",e.getMessage());
        return Result.error(e.getMessage()+"\n若有疑问，请联系陶虹润");
    }

}
